<?php
defined('IN_IA') or exit('Access Denied');
global $_GPC, $_W;
$aouthkey = $_GPC['aouthkey'];
$page = $_GPC['page'];
$cate_id = $_GPC['cate_id'];
$setting = $this->baseset($_W['uniacid']);
$nbkey = $setting['nbkey'];
$isstart = $_GPC['isstart'];
$isend = $_GPC['isend'];
$start = $_GPC['start'];
$new = $_GPC['new'];
$dingdan = $_GPC['dingdan'];
$shijian = $_GPC['shijian'];
if ($aouthkey == $nbkey) {
	if ($start && $new) {
		$data = array();
		$data['pc_remote'] = 1;
		$data['pc_start'] = $start;
		$data['pc_new'] = $new;
		pdo_update($this->tableset, $data, array('uniacid' => $_W['uniacid']));
	}
	if ($dingdan && $shijian) {
		$data = array();
		$data['pc_remote'] = 1;
		$data['pc_start'] = 0;
		$data['pc_new'] = 0;
		$data['pc_dingdan'] = $dingdan;
		$data['pc_shijian'] = $shijian;
		pdo_update($this->tableset, $data, array('uniacid' => $_W['uniacid']));
	}
	if ($isstart == 1 && $isend == 0) {
		$data = array();
		$data['pc_remote'] = 0;
		pdo_update($this->tableset, $data, array('uniacid' => $_W['uniacid']));
	}
	if ($isstart == 0 && $isend == 1) {
		$data = array();
		$data['pc_remote'] = 0;
		pdo_update($this->tableset, $data, array('uniacid' => $_W['uniacid']));
	}
	$pc_remote = $setting['pc_remote'];
	$pc_start = $setting['pc_start'];
	$pc_new = $setting['pc_new'];
	$pc_dingdan = $setting['pc_dingdan'];
	$pc_shijian = $setting['pc_shijian'];
	exit(json_encode(array('isok' => 'aouthkey ok!', 'remote' => $pc_remote, 'start' => $pc_start, 'new' => $pc_new, 'dingdan' => $pc_dingdan, 'shijian' => $pc_shijian)));
} else {
	exit(json_encode(array('isok' => 'aouthkey error!')));
}